package com.example.module_message.ui

import com.example.module_message.http.MessageApi
import com.example.module_message.http.MessageNetModule
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

class MessageRepository @Inject constructor() {
    @Inject
    @MessageNetModule.CommonMainApi
    lateinit var messageApi: MessageApi

    /*
    获取消息列表
     */
    fun getMessageList(accessId:String,userId:Int) = flow {
        emit(messageApi.getMessageList(accessId, userId))
    }.flowOn(Dispatchers.IO)
}